﻿<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Profile.aspx.vb" Inherits="CommunityWebsiteProject.Profile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-family: "Segoe UI";
            font-size: large;
        }
        
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource5" BorderStyle="None" GridLines="None" 
            Height="16px" Width="119px">
            <Columns>
                <asp:TemplateField HeaderText="Average Rating">
                <ItemTemplate><h1><%# getStars(Eval("AverageRating"))%>   </h1> </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TutorsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:TutorsConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [qryAverageTutorRating] WHERE ([TutorUserName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="TutorUserName" QueryStringField="TutorUserName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
    </p>
<div id="ProfilePage" style="width:500px;">
    <asp:ListView ID="lv_TutorProfile" runat="server" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <div id="Picture" style="float:right; margin-right:20px">
                <image src='<%# Eval("Picture") %>' alt="Profile Picture" width="200px" height="200px" />
            </div>
            <div id="Details" style="float:left;">
                <%# Eval("Title") %> <%# Eval("FirstName") %> <%# Eval("LastName") %> 
                <br />
                <b>PostCode:</b>&nbsp;&nbsp;&nbsp;%# Eval("PostCode") %>
                <br />
                Subject:&nbsp;&nbsp;&nbsp;<%# Eval("Subject") %><br />HourlyRate:&nbsp;&nbsp;&nbsp;£ <%# Eval("HourlyRate") %> 
                <br />
                Qualifications:&nbsp;&nbsp;&nbsp;<%# Eval("Qualifications") %><br />Experience:&nbsp;&nbsp;&nbsp;<%# Eval("Experience") %><br />Availability:&nbsp;&nbsp;&nbsp;<%# Eval("Availability") %><br />EmailAddress:&nbsp;&nbsp;&nbsp;<%# Eval("EmailAddress") %><br />TutorUserName:&nbsp;&nbsp;&nbsp;<%# Eval("TutorUserName") %></div>
<br />
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="">Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            FirstName:
            <asp:TextBox ID="FirstNameTextBox" runat="server" 
                Text='<%# Bind("FirstName") %>' />
            <br />
            LastName:
            <asp:TextBox ID="LastNameTextBox" runat="server" 
                Text='<%# Bind("LastName") %>' />
            <br />
            Picture:
            <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
            <br />
            Subject:
            <asp:TextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>' />
            <br />
            HourlyRate:
            <asp:TextBox ID="HourlyRateTextBox" runat="server" 
                Text='<%# Bind("HourlyRate") %>' />
            <br />
            PostCode:
            <asp:TextBox ID="PostCodeTextBox" runat="server" 
                Text='<%# Bind("PostCode") %>' />
            <br />
            TutorUserName:
            <asp:TextBox ID="TutorUserNameTextBox" runat="server" 
                Text='<%# Bind("TutorUserName") %>' />
            <br />
            EmailAddress:
            <asp:TextBox ID="EmailAddressTextBox" runat="server" 
                Text='<%# Bind("EmailAddress") %>' />
            <br />
            Availability:
            <asp:TextBox ID="AvailabilityTextBox" runat="server" 
                Text='<%# Bind("Availability") %>' />
            <br />
            Experience:
            <asp:TextBox ID="ExperienceTextBox" runat="server" 
                Text='<%# Bind("Experience") %>' />
            <br />
            Qualifications:
            <asp:TextBox ID="QualificationsTextBox" runat="server" 
                Text='<%# Bind("Qualifications") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style="">Title:l
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />FirstName:
            <asp:TextBox ID="FirstNameTextBox" runat="server" 
                Text='<%# Bind("FirstName") %>' />
            <br />LastName:
            <asp:TextBox ID="LastNameTextBox" runat="server" 
                Text='<%# Bind("LastName") %>' />
            <br />Picture:
            <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
            <br />Subject:
            <asp:TextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>' />
            <br />HourlyRate:
            <asp:TextBox ID="HourlyRateTextBox" runat="server" 
                Text='<%# Bind("HourlyRate") %>' />
            <br />PostCode:
            <asp:TextBox ID="PostCodeTextBox" runat="server" 
                Text='<%# Bind("PostCode") %>' />
            <br />TutorUserName:
            <asp:TextBox ID="TutorUserNameTextBox" runat="server" 
                Text='<%# Bind("TutorUserName") %>' />
            <br />EmailAddress:
            <asp:TextBox ID="EmailAddressTextBox" runat="server" 
                Text='<%# Bind("EmailAddress") %>' />
            <br />Availability:
            <asp:TextBox ID="AvailabilityTextBox" runat="server" 
                Text='<%# Bind("Availability") %>' />
            <br />Experience:
            <asp:TextBox ID="ExperienceTextBox" runat="server" 
                Text='<%# Bind("Experience") %>' />
            <br />Qualifications:
            <asp:TextBox ID="QualificationsTextBox" runat="server" 
                Text='<%# Bind("Qualifications") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            <div id="Picture" style="float:left; margin-right:20px">
                <image src='<%# Eval("Picture") %>' alt="Profile Picture" width="200px" height="200px" />
            </div>
            <br />
             <%# Eval("Title") %> <%# Eval("FirstName") %> <%# Eval("LastName") %> 
             <br />
             <b>Post Code:</b>&nbsp;&nbsp;&nbsp;<%# Eval("PostCode") %><br /><b>Subject:</b>&nbsp;&nbsp;&nbsp;<%# Eval("Subject") %><br /><b>Hourly Rate:</b>&nbsp;&nbsp;&nbsp;£<%# Eval("HourlyRate") %><br /><b>Qualifications:</b>&nbsp;&nbsp;&nbsp;<%# Eval("Qualifications") %><br /><b>Experience:</b>&nbsp;&nbsp;&nbsp;<%# Eval("Experience") %><br /><b>Availability:</b>&nbsp;&nbsp;&nbsp;<%# Eval("Availability") %><br /><b>Email Address:</b>&nbsp;&nbsp;&nbsp;<%# Eval("EmailAddress") %><br /><b>Tutor User Name:</b>&nbsp;&nbsp;&nbsp;<%# Eval("TutorUserName") %><br />
    
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>

            <div style="">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="">Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            FirstName:
            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
            <br />
            LastName:
            <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
            <br />
            Picture:
            <asp:Label ID="PictureLabel" runat="server" Text='<%# Eval("Picture") %>' />
            <br />
            Subject:
            <asp:Label ID="SubjectLabel" runat="server" Text='<%# Eval("Subject") %>' />
            <br />
            HourlyRate:
            <asp:Label ID="HourlyRateLabel" runat="server" 
                Text='<%# Eval("HourlyRate") %>' />
            <br />
            PostCode:
            <asp:Label ID="PostCodeLabel" runat="server" Text='<%# Eval("PostCode") %>' />
            <br />
            TutorUserName:
            <asp:Label ID="TutorUserNameLabel" runat="server" 
                Text='<%# Eval("TutorUserName") %>' />
            <br />
            EmailAddress:
            <asp:Label ID="EmailAddressLabel" runat="server" 
                Text='<%# Eval("EmailAddress") %>' />
            <br />
            Availability:
            <asp:Label ID="AvailabilityLabel" runat="server" 
                Text='<%# Eval("Availability") %>' />
            <br />
            Experience:
            <asp:Label ID="ExperienceLabel" runat="server" 
                Text='<%# Eval("Experience") %>' />
            <br />
            Qualifications:
            <asp:Label ID="QualificationsLabel" runat="server" 
                Text='<%# Eval("Qualifications") %>' />
            <br />
<br />
        </SelectedItemTemplate>
    </asp:ListView>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TutorsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:TutorsConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Title], [FirstName], [LastName], [Picture], [Subject], [HourlyRate], [PostCode], [TutorUserName], [EmailAddress], [Availability], [Experience], [Qualifications] FROM [tblTutorProfile] WHERE ([TutorUserName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="TutorUserName" QueryStringField="TutorUserName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    <br />
        <asp:Button ID="btn_EditProfile" runat="server" Text="Edit Profile" 
            PostBackUrl="~/editProfile.aspx" />
    </p>
    <div id="Comments" style="width:500px; float:left;">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BorderStyle="Solid" 
            HorizontalAlign="Left" Width="400px" BorderColor="#3366CC" >
            <Columns>
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="Comment" HeaderText="Comment" 
                    SortExpression="Comment" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TutorsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:TutorsConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [qryTutorComments]">
        </asp:SqlDataSource>
    </div>
 <br />
 <div id="AddComment" style="float:left; width:500px">
     <p>
         If you require the services of this tutor, enter a message below and click &quot;Send 
         Request To Tutor&quot;</p>
     <p>
         <asp:TextBox ID="tbRequestComment" runat="server" Height="54px" 
             TextMode="MultiLine" Width="320px"></asp:TextBox>
     </p>
     <p>
        <asp:Button ID="btnSendRequest" runat="server" Text="Send Request To Tutor" />&nbsp;</p>
     <p>
         &nbsp;<span class="style1">Add</span> <span class="style1">Rating</span>:</p>
     <p>
        </p>
        
     <asp:Rating ID="Rating1" runat="server"  EmptyStarCssClass = "starjpg" 
        FilledStarCssClass = "stardonejpg" StarCssClass = "stardonejpg"
    WaitingStarCssClass = "stardonejpg">
     </asp:Rating>
     <br />
     <asp:Button ID="btnAddRating" runat="server" Text="Add Rating"></asp:Button>
     <p>
         <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" 
             CombineScripts="False">
         </asp:ToolkitScriptManager>
     </p>
     <p>
         &nbsp;</p>
     <p>
        Add your comment here:</p>
    <p>
        Comment Title:&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="tb_CommentTitle" runat="server" Height="26px" Width="255px"></asp:TextBox>
    </p>
    <p>
        Comment
        <br /><asp:TextBox ID="tb_Comment" runat="server" Height="87px" 
            TextMode="MultiLine" Width="354px"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btn_AddComment" runat="server" Text="Add your comment" />
    </p>
    <p>  </p>
    </div>
    <div ="Tags" style="float:left;">
    <br />
        Tags:&nbsp;&nbsp;&nbsp;
        <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
            DataSourceID="SqlDataSource4" DataTextField="Tag" DataValueField="ID" 
            RepeatDirection="Horizontal">
            <asp:ListItem Value="10">Reliable</asp:ListItem>
            <asp:ListItem Value="11">Outstanding</asp:ListItem>
            <asp:ListItem Value="12">Knowledgeable</asp:ListItem>
            <asp:ListItem Value="13">Excellent</asp:ListItem>
            <asp:ListItem Value="14">Great</asp:ListItem>
        </asp:CheckBoxList>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TutorsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:TutorsConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [Tag] FROM [tblTags] WHERE ([Tag] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    <p></p>

        <p>Add your tags here seperated by commas:</p>
    <p>
        <asp:TextBox ID="tb_Tags" runat="server" Height="53px" TextMode="MultiLine" 
            Width="296px"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btn_AddTags" runat="server" Text="Add Tags" />
    </p>
    <p>
        &nbsp;</p>
      </div>
</div>

</asp:Content>
